package com.bawei.library_base.room.paygood;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;


import java.util.List;

/**
 * @author : zhiyu
 * @date : 2021/12/22
 * @content :
 */
@Dao
public interface PayGoodDao {
    //查询全部
    @Query("select * from paygood")
    List<PayGood> getAllGood();
    //添加
    @Insert
    void insert(PayGood goods);
    //修改
    @Update
    void update(PayGood goods);
    //删除
    @Delete
    void delete(PayGood goods);
    //根据商品的唯一标识删除
    @Query("delete from paygood where pgood_id=:goodId")
    void deleteGoodId(int goodId);
    //根据条件查询的唯一
    @Query("select * from paygood where pid=:id")
    public PayGood queryGoodById(int id);
}
